<?php
namespace Database;

class Document extends Base
{

    public function __construct()
    {
        $this->setModel(MODEL_DOCUMENT);
    }

    public function getList($categoryId = 0)
    {
        $sql = $this->getSql();
        $sql->field('*');
        $sql->table($this->getTable());
        $sql->where('dry_category', '=', $categoryId);
        $sql->andWhere('dry_status', '=', 1);
        $sql->setOrder('dry_sort', 'asc');
        return $this->fetchAll($sql->get());
    }

}